import React from 'react';
import './App.css';
import Game from "./pages/Game"
import List from "./pages/List"
import Lsoe from "./pages/Lose"
import { Provider } from "react-redux";
import store from "./store"
import {
  // 浏览器路由
  BrowserRouter,
  HashRouter,
  Switch,
  Route,
  Link,
  Redirect
} from "react-router-dom";
function App() {
  return (
    <BrowserRouter>
      <Provider store={store}>
        <div className="App">
          <Link to="/index">Game</Link>
          <Link to="/list">List</Link>
          <Switch>
            <Route path='/index' exat component={Game} />
            <Route path='/list/' component={List} />
            <Route path="/lose" component={Lsoe}></Route>
            {/* 路由重定向 与上方地址都不匹配时跳转到下面的地址 */}
            <Redirect from="/*" to="/lose" ></Redirect>
          </Switch>
        </div>
      </Provider>
    </BrowserRouter>

  );
}

export default App;
